<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 
?>

<!-- 카테고리 레이어 식작 -->
<div style="display:inline-block;"><img src="../img/product/bt_catalog.gif" width="99" class="cateClass" height="24" onclick="javascript:showCateg();" style="cursor:pointer;" /></div>
<input type="hidden" name="categDis" id="categDis" value="N">
<div class="tas cateClass" id="categLayer" style="display:none">
	<div style="margin-top:2px;width:770px;  border:1px solid #ccc; background:#fff;">
<?
	$colCnt = 1;
	$categCode = "";
	for ($i=0; $row=sql_fetch_array($category_arr); $i++) {
		
		if(strtolower($g4[charset])=="utf-8"){
			$categCode = "encodeURIComponent('".$row['CATEGORY_CODE']."')";
		}else{
			$categCode = $row['CATEGORY_CODE'];
		}
		
		if($row['CATEGORY_DEPTH'] == "1"){
			if($i > 1){
				echo "\n		</ul>";
				$colCnt++;
			}
			if($colCnt % 5 == 1){
				if($i > 1){
					echo "\n	</div>";
				}
				echo "\n	<div style=\"padding-bottom:30px; overflow:hidden;\">";
			}
			echo "\n		<ul>";
			//echo "\n			<li class=\"title\" style=\"cursor:pointer;\" onclick=\"location='".$category_location."'+".$categCode.";\">".$row['CATEGORY_NAME']."($row[ca_cnt])</li>";
			echo "\n			<li class=\"title\" style=\"cursor:pointer;\" onclick=\"location='".$category_location."'+".$categCode.";\">".$row['CATEGORY_NAME']."</li>";
		}else{
			//echo "\n			<li style=\"cursor:pointer;\" onclick=\"location='".$category_location."'+".$categCode.";\">".$row['CATEGORY_NAME']."($row[ca_cnt])</li>";
			echo "\n			<li style=\"cursor:pointer;\" onclick=\"location='".$category_location."'+".$categCode.";\">".$row['CATEGORY_NAME']."</li>";
		}
		
		if($i == mysql_num_rows($category_arr)-1){
			echo "\n		</ul>";
			echo "\n	</div>";
		}
	}
?> 		
		<div style="overflow:hidden;">
			<div style="float:right;"><img src="../img/product/bt_close.gif" onclick="javascript:showCateg();" style="vertical-align:bottom;cursor:pointer;"/></div>
		</div>
	</div>
</div>


<script type="text/javascript">
	function showCateg(){
		if($("#categDis").val() == "Y"){
			$("#categLayer").hide('fast');
			$("#categDis").val("N");
		}else{
			$("#categLayer").show('fast');
			$("#categDis").val("Y");
		}
	}

	function closeCateg(){
		if($("#categDis").val() == "Y"){
			$("#categLayer").hide('fast');
			$("#categDis").val("N");
		}
	}
	$(document).ready(function(){
		$(".cateClass").click(function(event){ 
			event.stopPropagation();
		});
		
		$(document.body).click(function(){
			closeCateg();
		});
	});
</script>
<!-- 카테고리 레이어 끝 -->
